from setuptools import setup, find_packages

# 将附加功能分组，以便按需安装
extras = {
    "database": [
        "sqlalchemy>=2.0.0",
        "asyncmy>=0.2.9",
        "aiomysql>=0.2.0",
        "asyncpg>=0.29.0",
        "alembic>=1.13.0",
    ],
    "mongodb": [
        "motor>=3.3.0",
    ],
    "auth": [
        "PyJWT>=2.0.0",
        "authlib>=1.2.0",
        "requests>=2.20.0",
        "bcrypt>=4.0.0",
        "passlib[bcrypt]>=1.7.4",
    ],
    "worker": [
        "arq>=0.26.0",
        "redis[async]>=4.0.0",
    ],
    "filesystem": [
        "aiofiles>=23.2.1",
        "fsspec>=2024.6.0",
        "s3fs>=2024.6.0",
    ],
    "sse": [
        "sse-starlette>=1.8.0",
    ],
    "scraper": [
        "playwright>=1.44.0",
    ],
    "ai": [
        # --- LangChain ---
        "langchain>=0.3.0",
        "langchain-openai>=0.3.0",
        "langchain-google-vertexai>=1.0.0",
        "langchain-community>=0.2.0",
        # --- LlamaIndex ---
        "llama-index>=0.10.0",
        "llama-index-vector-stores-postgres>=0.1.0",
        "psycopg2-binary>=2.9.0",
        "pgvector>=0.2.0",
        # --- LlamaIndex Rerankers & Semantic Splitters ---
        "sentence-transformers>=2.2.0",
        "torch>=2.7.0",
        "transformers>=4.53.0",
        # --- LlamaIndex Embeddings ---
        "llama-index-embeddings-dashscope>=0.1.0",
        "llama-index-embeddings-huggingface>=0.2.0",
        # --- LlamaIndex Readers (for Loader) ---
        "llama-index-readers-file>=0.1.0",
        "pypdf>=4.0.0",
        "python-docx>=1.1.0",
        "docx2txt>=0.8",
        "unstructured[md,html]>=0.14.0",
        "Pillow>=10.0.0",
    ],
    "dev": [
        "pytest>=7.0.0",
        "black>=23.0.0",
        "isort>=5.0.0",
    ]
}

# "all" 附加功能包包含了所有其他的附加功能
extras["all"] = sorted({p for extras_list in extras.values() for p in extras_list})

setup(
    name="axiom-boot",
    version="0.1.0",
    description="Python Spring Boot风格框架，基于FastAPI",
    author="AI Studio Team",
    package_dir={"": "src"},
    packages=find_packages(where="src"),
    install_requires=[
        # --- 核心框架依赖 ---
        "fastapi>=0.104.0",
        "uvicorn[standard]>=0.24.0",
        "python-multipart>=0.0.7",
        "starlette>=0.37.0",
        "httpx>=0.27.0",
        "pydantic>=2.0.0",
        "pydantic-settings>=2.0.0",
        "email-validator>=2.0.0",
        "python-dotenv>=1.0.0",
        "structlog>=23.2.0",
        "click>=8.0.0",
        "python-slugify>=8.0.0",
        "concurrent-log-handler>=0.9.28",
    ],
    extras_require=extras,
    python_requires=">=3.8",
)
